package cn.iocoder.idata.module.idata.dal.mysql.script;

import java.util.*;

import cn.iocoder.idata.framework.common.pojo.PageResult;
import cn.iocoder.idata.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.idata.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.idata.module.idata.dal.dataobject.script.ScriptDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.idata.module.idata.controller.admin.script.vo.*;

/**
 * 标注脚本管理 Mapper
 *
 * @author wanghaiyang
 */
@Mapper
public interface ScriptMapper extends BaseMapperX<ScriptDO> {

    default PageResult<ScriptDO> selectPage(ScriptPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ScriptDO>()
                .likeIfPresent(ScriptDO::getName, reqVO.getName())
                .orderByDesc(ScriptDO::getId));
    }

    default List<ScriptDO> selectList(ScriptExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<ScriptDO>()
                .likeIfPresent(ScriptDO::getName, reqVO.getName())
                .orderByDesc(ScriptDO::getId));
    }

}
